Test Failed
Push — master ( db6889...9321a0 )
by Dmytro
01:41
created

ValidationError.toJSON   A

Complexity

Conditions 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 2
1
export default class ValidationError extends Error {
2
    constructor(cottus, errors) {
3
        super();
4
        this.cottus = cottus;
5
        this.errors = errors;
6
    }
7
8
    toJSON() {
9
        return {
10
            code    : 'VALIDATION_ERROR',
11
            details : this.errors.map(e => e.hash)
12
        };
13
    }
14
}
15